<?php
use app\models\Activity;
use yii\helpers\Html;
use yii\helpers\Url;

/* @var $this \yii\web\View */
/* @var $model \app\models\Activity */
/* @var $user \app\models\User */

?>

<?php foreach ($models as $model): ?>
    <?php $url = Yii::$app->controller->action->id == 'apply-list' ? ['activity-apply', 'id' => $model->id] : ['publish/save', 'id' => $model->id, 'cid' => $model->cid, 'type' => $model->type]; ?>
    <div class="card-box">
        <div class="card-box-inner">
<!--            <div class="tag-hot">--><?//= $model->_statusName(); ?><!--</div>-->

            <div class="card-tag <?= Activity::$cidTag[$model->cid]; ?>"><?= Activity::$cidLabels[$model->cid]; ?></div>

            <div class="card-img">
                <a data-href="<?= $model->getIsEdit($user) || Yii::$app->controller->action->id == 'apply-list' ? Url::to($url) : ''; ?>">
                    <img src="<?= $model->getThumb(); ?>"/>
                </a>
            </div>
            <div class="card-content">
                <div class="card-content-title">
                    <h4><?= Html::encode($model->title); ?></h4>
<!--                    <span>--><?//= Html::encode($model->salary); ?><!--</span>-->
                </div>

                <div class="card-content-bd">
                    <?= Html::encode($model->company); ?>
                </div>

                <?= $this->render($model->getIsActivity() ? '/activity/__activity' : '/activity/__job', compact('model')); ?>
            </div>

        </div>
    </div>
<?php endforeach; ?>